package com.lz.service.impl;

import com.alicp.jetcache.anno.CacheType;
import com.alicp.jetcache.anno.Cached;
import com.lz.model.WebLog;
import com.lz.service.TestService;
import org.springframework.stereotype.Service;

/**
 * @Package com.lz.service.impl
 * @Project currency-trading
 * @Author lenovo
 * @Date 2022/1/10 15:15
 * @Describe TODO
 * @Version V1.0
 */
@Service
public class TestServiceImpl implements TestService {
    /**
     * 通过username 查询webLog
     */
    @Override
    @Cached(name = "com.lz.service.impl.TestServiceImpl:", key = "#username", cacheType = CacheType.BOTH)
    public WebLog get(String username) {
        WebLog webLog = new WebLog();
        webLog.setUsername(username);
        webLog.setResult("ok");
        return webLog;
    }
}
